package com.zero.xiaodai.utils;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;

public class HttpGetData {
	  
    public static Map getData(String url,Map<String, String> param){  
    	Map<String,Object> dataMap=new HashMap<>();
    	String charset = "utf-8";
    	HttpClientUtil httpClientUtil = new HttpClientUtil();  
        String httpOrgCreateTest = url ;  
        Map<String,String> createMap = new HashMap<String,String>();  
        createMap.put("authuser","*****");  
        createMap.put("authpass","*****");  
        createMap.put("orgkey","****");  
        createMap.put("orgname","****");  
        createMap.putAll(param);
        String httpOrgCreateTestRtn = httpClientUtil.doPost(httpOrgCreateTest,createMap,charset);  
        System.out.println("result:"+httpOrgCreateTestRtn);  
        
        
        
        
        JSONObject  jasonObject = JSONObject.parseObject(httpOrgCreateTestRtn);
        Map map = (Map)jasonObject;
        
        System.out.println(map.get("data"));
        /*String str=map.get("data").toString();
        dataMap.put("data", str);
        dataMap.put("dataNum", map.get("dataNum").toString());*/
        /*
        String dataStr=str.substring(2, str.length()-2);
        System.out.println(dataStr);
        String []strArr=dataStr.split("(\\}\\,\\{)");
        
        //List<Map> list=new ArrayList<Map>();
        System.out.println(strArr[0]);
        System.out.println(strArr[1]);
        */
        return map;
        /*
        for(String s:strArr){
        	Map spMap=new HashMap<String, String>();
        	jasonObject = JSONObject.parseObject(s);
        	spMap= (Map)jasonObject;
        	list.add(spMap);
        }
        */
    }  
      
   

}
